\hypertarget{commands_8c}{}\section{commands.\+c File Reference}
\label{commands_8c}\index{commands.\+c@{commands.\+c}}
{\ttfamily \#include \char`\"{}commands.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ch.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}hal.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}main.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}stm32f4xx\+\_\+conf.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}servo.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}servo\+\_\+simple.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}buffer.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}my\+U\+S\+B.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}terminal.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}hw.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}mcpwm.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}app.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}timeout.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}servo\+\_\+dec.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}comm\+\_\+can.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}flash\+\_\+helper.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}utils.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}packet.\+h\char`\"{}}\\*
{\ttfamily \#include $<$math.\+h$>$}\\*
{\ttfamily \#include $<$string.\+h$>$}\\*
{\ttfamily \#include $<$stdarg.\+h$>$}\\*
{\ttfamily \#include $<$stdio.\+h$>$}\\*
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{commands_8c_a3e9ed14716fd984977306110fbf28de0}{commands\+\_\+init} (void)
\item 
void \hyperlink{commands_8c_a7113093d2be86cea25c5912bd65e076e}{commands\+\_\+set\+\_\+send\+\_\+func} (void($\ast$func)(unsigned char $\ast$data, unsigned int len))
\item 
void \hyperlink{commands_8c_aa14d526ab86f5c11373e6e0bac4f4cd5}{commands\+\_\+send\+\_\+packet} (unsigned char $\ast$data, unsigned int len)
\item 
void \hyperlink{commands_8c_a97c11cc3375b8303020a4c57c9cd743b}{commands\+\_\+process\+\_\+packet} (unsigned char $\ast$data, unsigned int len)
\item 
void \hyperlink{commands_8c_aaef6894a0ffba8cc765b106497238adc}{commands\+\_\+printf} (char $\ast$format,...)
\item 
void \hyperlink{commands_8c_ac16d71d48d810c2846a12e6167197ee3}{commands\+\_\+send\+\_\+samples} (uint8\+\_\+t $\ast$data, int len)
\item 
void \hyperlink{commands_8c_a59740b05fad260d1259cc0642c553799}{commands\+\_\+send\+\_\+rotor\+\_\+pos} (float rotor\+\_\+pos)
\item 
void \hyperlink{commands_8c_a84dad9e338be1c2716b8687616582ffd}{commands\+\_\+send\+\_\+experiment\+\_\+samples} (float $\ast$samples, int len)
\end{DoxyCompactItemize}


\subsection{Function Documentation}
\hypertarget{commands_8c_a3e9ed14716fd984977306110fbf28de0}{}\index{commands.\+c@{commands.\+c}!commands\+\_\+init@{commands\+\_\+init}}
\index{commands\+\_\+init@{commands\+\_\+init}!commands.\+c@{commands.\+c}}
\subsubsection[{commands\+\_\+init(void)}]{\setlength{\rightskip}{0pt plus 5cm}void commands\+\_\+init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{commands_8c_a3e9ed14716fd984977306110fbf28de0}
\hypertarget{commands_8c_aaef6894a0ffba8cc765b106497238adc}{}\index{commands.\+c@{commands.\+c}!commands\+\_\+printf@{commands\+\_\+printf}}
\index{commands\+\_\+printf@{commands\+\_\+printf}!commands.\+c@{commands.\+c}}
\subsubsection[{commands\+\_\+printf(char $\ast$format,...)}]{\setlength{\rightskip}{0pt plus 5cm}void commands\+\_\+printf (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{format, }
\item[{}]{...}
\end{DoxyParamCaption}
)}\label{commands_8c_aaef6894a0ffba8cc765b106497238adc}
\hypertarget{commands_8c_a97c11cc3375b8303020a4c57c9cd743b}{}\index{commands.\+c@{commands.\+c}!commands\+\_\+process\+\_\+packet@{commands\+\_\+process\+\_\+packet}}
\index{commands\+\_\+process\+\_\+packet@{commands\+\_\+process\+\_\+packet}!commands.\+c@{commands.\+c}}
\subsubsection[{commands\+\_\+process\+\_\+packet(unsigned char $\ast$data, unsigned int len)}]{\setlength{\rightskip}{0pt plus 5cm}void commands\+\_\+process\+\_\+packet (
\begin{DoxyParamCaption}
\item[{unsigned char $\ast$}]{data, }
\item[{unsigned int}]{len}
\end{DoxyParamCaption}
)}\label{commands_8c_a97c11cc3375b8303020a4c57c9cd743b}
Process a received buffer with commands and data.


\begin{DoxyParams}{Parameters}
{\em data} & The buffer to process.\\
\hline
{\em len} & The length of the buffer. \\
\hline
\end{DoxyParams}
\hypertarget{commands_8c_a84dad9e338be1c2716b8687616582ffd}{}\index{commands.\+c@{commands.\+c}!commands\+\_\+send\+\_\+experiment\+\_\+samples@{commands\+\_\+send\+\_\+experiment\+\_\+samples}}
\index{commands\+\_\+send\+\_\+experiment\+\_\+samples@{commands\+\_\+send\+\_\+experiment\+\_\+samples}!commands.\+c@{commands.\+c}}
\subsubsection[{commands\+\_\+send\+\_\+experiment\+\_\+samples(float $\ast$samples, int len)}]{\setlength{\rightskip}{0pt plus 5cm}void commands\+\_\+send\+\_\+experiment\+\_\+samples (
\begin{DoxyParamCaption}
\item[{float $\ast$}]{samples, }
\item[{int}]{len}
\end{DoxyParamCaption}
)}\label{commands_8c_a84dad9e338be1c2716b8687616582ffd}
\hypertarget{commands_8c_aa14d526ab86f5c11373e6e0bac4f4cd5}{}\index{commands.\+c@{commands.\+c}!commands\+\_\+send\+\_\+packet@{commands\+\_\+send\+\_\+packet}}
\index{commands\+\_\+send\+\_\+packet@{commands\+\_\+send\+\_\+packet}!commands.\+c@{commands.\+c}}
\subsubsection[{commands\+\_\+send\+\_\+packet(unsigned char $\ast$data, unsigned int len)}]{\setlength{\rightskip}{0pt plus 5cm}void commands\+\_\+send\+\_\+packet (
\begin{DoxyParamCaption}
\item[{unsigned char $\ast$}]{data, }
\item[{unsigned int}]{len}
\end{DoxyParamCaption}
)}\label{commands_8c_aa14d526ab86f5c11373e6e0bac4f4cd5}
Send a packet using the set send function.


\begin{DoxyParams}{Parameters}
{\em data} & The packet data.\\
\hline
{\em len} & The data length. \\
\hline
\end{DoxyParams}
\hypertarget{commands_8c_a59740b05fad260d1259cc0642c553799}{}\index{commands.\+c@{commands.\+c}!commands\+\_\+send\+\_\+rotor\+\_\+pos@{commands\+\_\+send\+\_\+rotor\+\_\+pos}}
\index{commands\+\_\+send\+\_\+rotor\+\_\+pos@{commands\+\_\+send\+\_\+rotor\+\_\+pos}!commands.\+c@{commands.\+c}}
\subsubsection[{commands\+\_\+send\+\_\+rotor\+\_\+pos(float rotor\+\_\+pos)}]{\setlength{\rightskip}{0pt plus 5cm}void commands\+\_\+send\+\_\+rotor\+\_\+pos (
\begin{DoxyParamCaption}
\item[{float}]{rotor\+\_\+pos}
\end{DoxyParamCaption}
)}\label{commands_8c_a59740b05fad260d1259cc0642c553799}
\hypertarget{commands_8c_ac16d71d48d810c2846a12e6167197ee3}{}\index{commands.\+c@{commands.\+c}!commands\+\_\+send\+\_\+samples@{commands\+\_\+send\+\_\+samples}}
\index{commands\+\_\+send\+\_\+samples@{commands\+\_\+send\+\_\+samples}!commands.\+c@{commands.\+c}}
\subsubsection[{commands\+\_\+send\+\_\+samples(uint8\+\_\+t $\ast$data, int len)}]{\setlength{\rightskip}{0pt plus 5cm}void commands\+\_\+send\+\_\+samples (
\begin{DoxyParamCaption}
\item[{uint8\+\_\+t $\ast$}]{data, }
\item[{int}]{len}
\end{DoxyParamCaption}
)}\label{commands_8c_ac16d71d48d810c2846a12e6167197ee3}
\hypertarget{commands_8c_a7113093d2be86cea25c5912bd65e076e}{}\index{commands.\+c@{commands.\+c}!commands\+\_\+set\+\_\+send\+\_\+func@{commands\+\_\+set\+\_\+send\+\_\+func}}
\index{commands\+\_\+set\+\_\+send\+\_\+func@{commands\+\_\+set\+\_\+send\+\_\+func}!commands.\+c@{commands.\+c}}
\subsubsection[{commands\+\_\+set\+\_\+send\+\_\+func(void($\ast$func)(unsigned char $\ast$data, unsigned int len))}]{\setlength{\rightskip}{0pt plus 5cm}void commands\+\_\+set\+\_\+send\+\_\+func (
\begin{DoxyParamCaption}
\item[{void($\ast$)(unsigned char $\ast$data, unsigned int len)}]{func}
\end{DoxyParamCaption}
)}\label{commands_8c_a7113093d2be86cea25c5912bd65e076e}
Provide a function to use the next time there are packets to be sent.


\begin{DoxyParams}{Parameters}
{\em func} & A pointer to the packet sending function. \\
\hline
\end{DoxyParams}
